Skip to content

Add errno.ENOTCAPABLE#14748

Merged
srittau merged 3 commits intopython:mainfrom
srittau:ENOTCAPABLE
Sep 19, 2025
Merged

Add errno.ENOTCAPABLE#14748
srittau merged 3 commits intopython:mainfrom
srittau:ENOTCAPABLE

Conversation

@srittau
Copy link
Copy Markdown
Collaborator

@srittau srittau commented Sep 19, 2025

Part of #14741

@srittau
Copy link
Copy Markdown
Collaborator Author

srittau commented Sep 19, 2025

Remaining errors are handling in other PRs.

@github-actions

This comment has been minimized.

stdlib/errno.pyi Outdated
ESHLIBVERS: Final[int]
if sys.version_info >= (3, 11):
EQFULL: Final[int]
if sys.version_info >= (3, 14):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently this was added as early as 3.11.1: https://github.com/python/cpython/pull/96038/files

Not sure why it started showing up in stubtest now.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had seen that, but dismissed it. I will add it and just add it to the stubtest exclude lists for now (if there is an error).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails only on MacOS. I found no indication online that the errno exists on MacOS, but shrug. Agree it's best to claim it's present and allowlist the errors on 3.11-3.13.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation says it's a WASI errno. For some reason it also says that it's supported on FreeBSD. But since both are not supported platforms for typing purposes, maybe it's best to just remove the errno for now (with a stubtest allowlist) entry? Or add it unconditionally, not just on MacOS?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evidently it's at least sometimes present on macOS 9in the GitHub runner). I don't feel too strongly but in general I'd err on the side of over-including this kind of constant; people who use them will generally know to use hasattr()-type checks and it's a better experience if they're incorrectly present in the stub than if they're missing.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit b158ccd into python:main Sep 19, 2025
63 checks passed
@srittau srittau deleted the ENOTCAPABLE branch September 19, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants